<template>
  <div>1234</div>
</template>

<script>
import { fileAPI } from "@/utils/api.js";
export default {
  beforeCreate() {
    console.log(this.$route.query.image)
    if (!this.$route.query.image) {
      this.$router.replace("/home");
    }
    return;
  },
  computed: {
    image() {
      return this.$route.query.image;
    }
  },
  mounted() {
    if (this.image) {
      this.getShareFile();
    }
  },
  methods: {
    getShareFile() {
      fileAPI.share
        .getShareFile({
          code: "n2ng",
          image: this.$route.query.image
        })
        .then(res => {
          console.log(res);
        })
        .catch(err => {
          console.log(err);
        });
    }
  }
};
</script>

<style lang="scss" scoped>
</style>